//
//  HDMNMeVC.m
//  MyViews
//
//  Created by 孙志洪 on 2016/10/17.
//  Copyright © 2016年 HDMN. All rights reserved.
//

#import "HDMNMeVC.h"
#import "HDMNFirstView.h"
@interface HDMNMeVC ()

@end

@implementation HDMNMeVC
+(void)load{
 
    }
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blueColor];
    self.navigationItem.title = @"首页";
    
   [self addButton];
    // Do any additional setup after loading the view.
}
-(void)addButton{
    UIButton *first = [[UIButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width/4, self.view.frame.size.height/3, self.view.frame.size.width/3, self.view.frame.size.height/8)];
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
     dict[NSForegroundColorAttributeName] = [UIColor redColor];
    dict[NSFontAttributeName] = [UIFont systemFontOfSize:10];
    NSAttributedString *att = [[NSAttributedString alloc]initWithString:@"第一个" attributes:dict];
    [first setAttributedTitle:att forState:UIControlStateNormal];
    
    first.backgroundColor = [UIColor greenColor];
    [first addTarget:self action:@selector(firstSelect) forControlEvents:UIControlEventTouchUpInside];
    first.layer.cornerRadius = 10;
    [self.view addSubview:first];
    
    
    UIButton *second = [[UIButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width/4, self.view.frame.size.height/2, self.view.frame.size.width/3, self.view.frame.size.height/8)];

    NSMutableDictionary *dicts = [NSMutableDictionary dictionary];
    dict[NSForegroundColorAttributeName] = [UIColor greenColor];
    NSAttributedString *atts = [[NSAttributedString alloc]initWithString:@"第二个" attributes:dicts];
    [second setAttributedTitle:atts forState:UIControlStateNormal];
    second.backgroundColor = [UIColor redColor];
  
    [second addTarget:self action:@selector(secondtSelect) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:second];

}
-(void)firstSelect{
    NSLog(@"第一个");
    HDMNFirstView *firstView = [[HDMNFirstView alloc]init];
    firstView.hidesBottomBarWhenPushed = YES;

    [self.navigationController pushViewController:firstView animated:YES];
    
}


-(void)secondtSelect{
    NSLog(@"第二个");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
